/*
 * Central position of internal - global types
 */
#ifndef LE_TYPES_DE_BOON
#define LE_TYPES_DE_BOON
#include "Configuration.h"
#include "BoonException.h"
#include <vector>
#include <list>
#include <map>
#include <assert.h>

#if defined _DEBUG
#define BOON_ASSERT( exp ) assert( exp );
#else
#define BOON_ASSERT( exp )
#endif

namespace fastdelegate
{

	template<class Param1, class RetType>
	class FastDelegate1;
}

namespace Boon
{
	template<typename T>
	class Shared_ptr;
	template<typename T>
	class Weak_ptr;

	

	class GameObject;
	typedef Weak_ptr<GameObject>				GameObjectWeak;
	typedef Shared_ptr<GameObject>				GameObjectStrong;
	class GameComponent;
	typedef Weak_ptr<GameComponent>				GameComponentWeak;
	typedef Shared_ptr<GameComponent>			GameComponentStrong;
	class IMessengerEvent;
	typedef Shared_ptr<IMessengerEvent>			IMessengerEventStrong;
	typedef Weak_ptr<IMessengerEvent>			IMessengerEventWeak;
	class Renderer;
	typedef Shared_ptr<Renderer>				RendererStrong;
	typedef Weak_ptr<Renderer>					RendererWeak;
	class Transform;
	typedef Shared_ptr<Transform>				TransformStrong;
	typedef Weak_ptr<Transform>					TransformWeak;
	class Collider;
	typedef Shared_ptr<Collider>				ColliderStrong;
	typedef Weak_ptr<Collider>					ColliderWeak;
	class Rigidbody;
	typedef Shared_ptr<Rigidbody>				RigidbodyStrong;
	typedef Weak_ptr<Rigidbody>					RigidbodyWeak;
	class ColliderSphere;
	typedef Shared_ptr<ColliderSphere>			ColliderSphereStrong;
	typedef Weak_ptr<ColliderSphere>			ColliderSphereWeak;
	class ColliderBox;
	typedef Shared_ptr<ColliderBox>				ColliderBoxStrong;
	typedef Weak_ptr<ColliderBox>				ColliderBoxWeak;
	class ColliderCapsule;
	typedef Shared_ptr<ColliderCapsule>			ColliderCapsuleStrong;
	typedef Weak_ptr<ColliderCapsule>			ColliderCapsuleWeak;
	class IObserverPhysics;
	typedef Shared_ptr<IObserverPhysics>		IObserverPhysicsStrong;
	typedef Weak_ptr<IObserverPhysics>			IObserverPhysicsWeak;

	class Vector2;
	class Vector3;
	class Matrix44;
	class Messenger;
	class Bounds;
	class MaterialPhysics;

	typedef fastdelegate::FastDelegate1
		<const IMessengerEventStrong&,void>		EventListener; 		/*!< Type used to register to Events banged by Boon::Messenger */
	typedef std::vector<ColliderWeak>			ColliderResult;


	// Wrapping primitive types
	typedef unsigned int						uint_32;
	typedef unsigned long						EventType;
	typedef uint_32								GameObjectID;
	typedef uint_32								ComponentID;

	
	namespace Rendering
	{
		class SceneNode;
		class Material;
		class SceneNodeProperties;
		
		class ISceneNode;
		typedef Shared_ptr<ISceneNode>	ISceneNodeStrong;
		typedef Weak_ptr<ISceneNode>	ISceneNodeWeak;
		class RootNode;
		typedef Shared_ptr<RootNode>	RootNodeStrong;
		typedef Weak_ptr<RootNode>		RootNodeWeak;
		class CameraNode;
		typedef Shared_ptr<CameraNode>	CameraNodeStrong;
		typedef Weak_ptr<CameraNode>	CameraNodeWeak;
		class Material;


		enum RenderPass
		{
			PASS_0 = 0,
			PASS_STATIC = 0,
			PASS_GAMEOBECT,
			PASS_SKY,
			PASS_ALPHA,
			PASS_NOT_RENDERED,
			PASS_LAST
		};
	}
	typedef Rendering::Material		Material;
	typedef Rendering::RenderPass	RenderPass;

	struct RaycastHit;

	// Enumerations

	enum _gTime { LE_INFINITE = 0xffffffff };

	enum MessageQueueType
	{
		QUEUETYPE_LOGIC = 0,
		QUEUETYPE_SCENENODE = 2
	};

	enum RigidbodyConstraint
	{
		RIGC_NONE = 0,
		RIGC_FREEZE_POS_X = 1,
		RIGC_FREEZE_POS_Y = 2,
		RIGC_FREEZE_POS_Z = 4,
		RIGC_FREEZE_ROT_X = 8,
		RIGC_FREEZE_ROT_Y = 16,
		RIGC_FREEZE_ROT_Z = 32,
		RIGC_FREEZE_POSITION = 7,
		RIGC_FREEZE_ROTATION = 56,
		RIGC_FREEZE_ALL = 63
	};

	enum ForceMode
	{
		FM_FORCE,
		FM_IMPULSE
	};

	enum PhysicsCombineMode
	{
		FCM_AVERAGE		= 0,		//!< Average: (a + b)/2
		FCM_MIN			= 1,		//!< Minimum: minimum(a,b)
		FCM_MULTIPLY	= 2,		//!< Multiply: a*b
		FCM_MAX			= 3,		//!< Maximum: maximum(a,b)
		FCM_VALUES		= 4,		//!< This is not a valid combine mode, it is a sentinel to denote the number of possible values. We assert that the variable's value is smaller than this.
		FCM_PAD_32		= 0x7fffffff //!< This is not a valid combine mode, it is to assure that the size of the enum type is big enough.
	};

	/*!
	* Used to define collider objects with GetType()
	*/
	enum ColliderType
	{
		CT_BOX,
		CT_SPHERE,
		CT_CAPSULE
	};
}

#endif